The Tab View Component > FTabView.getLabelField() |
FTabView.getLabelField()
Availability
Flash Player 6.
Usage
myTab_tbv.getLabelField ()
Parameters
none
Returns
Returns a String specifying the name of the field that will be used to define the label of each individual tab.
Description
Returns a String specifying the name of the field that will be used to define the label of each individual tab. This allows you to pass Data Providers directly to the component and specify which field should be used for the label name. The default value is "label".
Notes
The name of the property that contains the name of the tab can be changed using the setLabelField method. The default value is "label".
Example
The tab_addListener.fla example file contains an example of using this method.
The following code creates a data provider with two properties, firstName and lastName. It then creates tabs based on the data provider, and uses setLabelField to map the firstName property to be used as the label for the tab.
var dp = new Array();
dp.push({firstName:"Homer", lastName:"Simpson"});
dp.push({firstName:"Bart", lastName:"Simpson"});
dp.push({firstName:"Maggie", lastName:"Simpson"});
trace(myTab_tbv.getLabelField());//traces label
myTab_tbv.setLabelField("firstName");
myTab_tbv.setDataProvider(dp);
trace(myTab_tbv.getLabelField());//traces firstName
See also